Creates a package reader to read the specified package from SharePoint. This constructor optionally causes the file to be read from SharePoint using elevated permissions.
Parent Type: SharePointPackageReader
Namespace: Microsoft.LearningComponents.SharePoint
Assembly: Microsoft.LearningComponents.SharePoint.dll
| C# |
|
public SharePointPackageReader ( ) |
cacheSettings
The settings to use for the caching of this package. A subdirectory will be created in the cacheSettings.CachePath location with a cached version of this package.
packageLocation
The location of the package to be read. Any changes to this SharePointFileLocation object after the SharePointPackageReader is created are not reflected in the behavior of this object.
runWithElevatedPrivileges
If true, files in SharePoint are accessed using elevated privileges. If false, the current user credentials are used to access SharePoint files.
| Exception type | Condition |
| ArgumentNullException | Thrown if any argument is null. |
| DirectoryNotFoundException | Thrown if the CachePath property of cacheSettings does not exist prior to calling this constructor. |
| FileNotFoundException | Thrown if the requested file does not exist. |
| UnauthorizedAccessException | Thrown if the identity doesn't have access to the CachePath provided in the cache settings. |
In addition to the exceptions listed below, this method may throw exceptions caused by the identity not having access to the cacheSettings CachePath location.
The contents of the package are not read in the constructor. The contents of the package are read only once when they are first needed. If the referenced SharePoint file does not contain a valid e-learning package, accessing other methods and properties on this object will result in an InvalidPackageException.
If the cacheSettings CacheInvalidPackageAsFile value is true, e-learning packages that do not contain basic package information are saved as files in the cache. In particular, this may increase performance in processing of zip files that do not contain e-learning content. If false, SharePointPackageReader will not cache zip files that are not e-learning content. In that case, an application that wants to cache this file would need to cache it as a CachedSharePointFile. Regardless of the value of this parameter, the SharePointPackageReader will not allow accessing files from within a package that is not e-learning content.